#include <stdio.h>
#include <stdlib.h>
#include <string.h>

#include "galois.h"

static int prim_poly[9] = 
{ 0, 
/*  1 */     1, 
/*  2 */    07,
/*  3 */    013,
/*  4 */    023,
/*  5 */    045,
/*  6 */    0103,
/*  7 */    0211,
/*  8 */    0435,
};

static int nw[9] = { 0, (1 << 1), (1 << 2), (1 << 3), (1 << 4), 
	(1 << 5), (1 << 6), (1 << 7), (1 << 8) };
	
static int nwm1[33] = { 0, (1 << 1)-1, (1 << 2)-1, (1 << 3)-1, (1 << 4)-1, 
	(1 << 5)-1, (1 << 6)-1, (1 << 7)-1, (1 << 8)-1 };

static char *galois_w08_log_tables[9] = { NULL, NULL, NULL, NULL, NULL, NULL, NULL,
	NULL, NULL };
	
static char *galois_w08_ilog_tables[9] = { NULL, NULL, NULL, NULL, NULL, NULL, NULL,
	NULL, NULL };
	
static char *galois_w08_mult_tables[9] = { NULL, NULL, NULL, NULL, NULL, NULL, NULL,
	NULL, NULL };

static char *galois_w08_div_tables[9] = { NULL, NULL, NULL, NULL, NULL, NULL, NULL,
	NULL, NULL };